<?php
/* @var $this CobranzasController */
/* @var $model Movimientocyb */

$this->breadcrumbs=array(
	'Movimientocybs'=>array('index'),
	'Manage',
);

$this->menu=array(

	array('label'=>'Crear Cobranza', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#movimientocyb-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<?php echo CHtml::link('Busqueda Avanzada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'movimientocyb-grid',
	'dataProvider'=>$model->cobranzas()->search(),
	'filter'=>$model,
	'columns'=>array(
		array('name'=>'fecha','value'=>'Yii::app()->dateFormatter->format("dd/MM/yyyy",strtotime($data->fecha))'),

		//'idMovimientoCyB',
		//'medio',
		array('name'=>'tComprobante','value'=>'$data->tComprobante0->descripcion','filter'=>CHtml::listData(Comprobante::model()->findAll(array('order'=>'descripcion','condition'=>'idComprobante in (1,4,9,11,3)')),"idComprobante","descripcion")),
		'pComprobante',
		'nComprobante',
		array('name'=>'importe','value'=>'"$ ".$data->importe'),

		/*
		'aQuien',
	
		'observacion',
		*/
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view}{delete}'
		),
	),
)); ?>
